<?php
	class empschoolmodel extends Model {
		function empschoolmodel()
		{
			parent::Model();			
		}
		
		function add($data)
		{
			$this->db->set('create_date', 'NOW()', FALSE); 
			$this->db->set('create_by', "'". $this->session->userdata('username') ."'", FALSE);
			$this->db->insert('employee_school', $data);
			return $this->db->insert_id();
		}
		
		
		function getByID($id)
		{
			$this->db->order_by("school_id", "desc"); 
			$query = $this->db->get_where('employee_school', array('employee_id' => $id));
			return $query->result();
		}
				
		function delete($data)
		{	
			$this->db->where('employee_id', $data);
			$this->db->delete('employee_school');
		}
	}
?>